package com.ticket.sass.provider.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ticket.sass.common.entity.tenant.AppEntity;
import com.ticket.sass.provider.mapper.AppMapper;
import com.ticket.sass.provider.service.BaseService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ywb
 * @since 2024-04-07
 */
@Service
public class AppServiceImpl extends ServiceImpl<AppMapper, AppEntity> implements BaseService<AppEntity> {
    public List<Long> idList() {
        // 使用MyBatis-Plus的list方法获取所有实体
        List<AppEntity> entities = this.list();
        // 提取所有ID并返回
        return entities.stream()
            .map(AppEntity::getId)
            .collect(Collectors.toList());
    }
}
